﻿package Message.Public
{
    import Framework.MQ.*;
    import Framework.Serialize.*;
    import flash.utils.*;

    public class SPublicPet extends IMessageBase
    {
        public var entityId:SEntityId;
        public var ownerEntityId:SEntityId;
        public var uid:String;
        public var name:String;
        public var specialName:String;
        public var type:int;
        public var level:int;
        public var code:int;
        public var model:int;
        public var life:int;
        public var mana:int;
        public var needLevel:int;
        public var experience:Number;
        public var lifeSpan:int;
        public var maxLifeSpan:int;
        public var combat:int;
        public var sharpNum:int;
        public var totemNum:int;
        public var growth:int;
        public var growthBless:int;
        public var growthRefreshNum:int;
        public var growthMax:int;
        public var blessExpiredDt:Date;
        public var advanceReturn:int;
        public var talent:int;
        public var talentMax:int;
        public var blood:String;
        public var state:int;
        public var skillIds:Dictionary;
        public var lastDeadDt:Date;
        public const _type:int = 83;
        public static var _regist:SPublicPet = new SPublicPet(true);

        public function SPublicPet(param1:Boolean = false)
        {
            if (param1)
            {
                MessageManager.instance().regist(this);
            }
            return;
        }// end function

        override public function getType() : int
        {
            return this._type;
        }// end function

        override public function clone() : IMessageBase
        {
            return new SPublicPet();
        }// end function

        override public function __write(param1:SerializeStream) : void
        {
            this.entityId.__write(param1);
            this.ownerEntityId.__write(param1);
            param1.writeString(this.uid);
            param1.writeString(this.name);
            param1.writeString(this.specialName);
            param1.writeByte(this.type);
            param1.writeByte(this.level);
            param1.writeInt(this.code);
            param1.writeInt(this.model);
            param1.writeInt(this.life);
            param1.writeInt(this.mana);
            param1.writeByte(this.needLevel);
            param1.writeLong(this.experience);
            param1.writeInt(this.lifeSpan);
            param1.writeInt(this.maxLifeSpan);
            param1.writeInt(this.combat);
            param1.writeInt(this.sharpNum);
            param1.writeInt(this.totemNum);
            param1.writeByte(this.growth);
            param1.writeInt(this.growthBless);
            param1.writeInt(this.growthRefreshNum);
            param1.writeByte(this.growthMax);
            param1.writeDate(this.blessExpiredDt);
            param1.writeInt(this.advanceReturn);
            param1.writeShort(this.talent);
            param1.writeShort(this.talentMax);
            param1.writeString(this.blood);
            param1.writeByte(this.state);
            DictIntIntHelper.write(param1, this.skillIds);
            param1.writeDate(this.lastDeadDt);
            return;
        }// end function

        override public function __read(param1:SerializeStream) : void
        {
            this.entityId = new SEntityId();
            this.entityId.__read(param1);
            this.ownerEntityId = new SEntityId();
            this.ownerEntityId.__read(param1);
            this.uid = param1.readString();
            this.name = param1.readString();
            this.specialName = param1.readString();
            this.type = param1.readByte();
            this.level = param1.readByte();
            this.code = param1.readInt();
            this.model = param1.readInt();
            this.life = param1.readInt();
            this.mana = param1.readInt();
            this.needLevel = param1.readByte();
            this.experience = param1.readLong();
            this.lifeSpan = param1.readInt();
            this.maxLifeSpan = param1.readInt();
            this.combat = param1.readInt();
            this.sharpNum = param1.readInt();
            this.totemNum = param1.readInt();
            this.growth = param1.readByte();
            this.growthBless = param1.readInt();
            this.growthRefreshNum = param1.readInt();
            this.growthMax = param1.readByte();
            this.blessExpiredDt = param1.readDate();
            this.advanceReturn = param1.readInt();
            this.talent = param1.readShort();
            this.talentMax = param1.readShort();
            this.blood = param1.readString();
            this.state = param1.readByte();
            this.skillIds = DictIntIntHelper.read(param1);
            this.lastDeadDt = param1.readDate();
            return;
        }// end function

    }
}
